package com.information.manage.basic.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.information.manage.basic.model.entity.SysRoleDO;
import com.information.manage.basic.model.query.AddRoleDepartmentQuery;
import com.information.manage.basic.model.query.AddRoleMenuQuery;
import com.information.manage.basic.model.query.FindRolePageQuery;
import com.information.manage.basic.model.query.SysRoleAddQuery;
import com.information.manage.basic.model.vo.RoleDepartmentAuthorityVO;
import com.information.manage.basic.model.vo.RoleMenuAuthorityVO;
import com.information.manage.basic.model.vo.SysRoleIdAndNameVO;
import com.information.manage.basic.model.vo.SysRolePageVO;
import com.information.manage.basic.common.result.Result;

import java.util.List;

public interface SysRoleService extends IService<SysRoleDO> {

    /**
     * 添加角色
     * @param sysRoleAddQuery
     * @return
     */
    Result<Integer> addRole(SysRoleAddQuery sysRoleAddQuery);

    /**
     * 删除角色
     * @param roleIds
     * @return
     */
    Boolean deleteRole(List<Integer> roleIds);

    /**
     * 角色分页
     * @param findRolePageQuery
     * @return
     */
    Result<Page<SysRolePageVO>> queryPageRole(FindRolePageQuery findRolePageQuery);

    /**
     * 角色list
     * @return
     */
    Result<List<SysRoleIdAndNameVO>> queryListRole();

    /**
     * 添加角色的部门权限
     * @param addRoleDepartmentQuery
     * @return
     */
    Result<Boolean> addRoleDepartment(AddRoleDepartmentQuery addRoleDepartmentQuery);

    /**
     * 添加角色的菜单权限
     * @param addRoleMenuQuery
     * @return
     */
    Result<Boolean> addRoleMenu(AddRoleMenuQuery addRoleMenuQuery);

    /**
     * admin添加菜单权限
     * @param adminRoleId
     * @return
     */
    Result<Boolean> addAdminMenu(Integer adminRoleId);

    /**
     * 查询角色的部门权限
     * @param roleId
     * @param typeCollection
     * @return
     */
    Result<List<RoleDepartmentAuthorityVO>> queryDepartment(Integer roleId, Integer typeCollection);

    /**
     * 查询角色的菜单权限
     * @param roleId
     * @return
     */
    Result<List<RoleMenuAuthorityVO>> queryRoleMenu(Integer roleId);
}
